﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Diagnostics;

namespace ForexService
{
    // NOTE: If you change the class name "Service1" here, you must also update the reference to "Service1" in Web.config and in the associated .svc file.
    public class ForexNewsService : IForexNewsService
    {
        public string GetData(int value)
        {
            return string.Format("You entered: {0}", value);
        }

        public List<ForexNews> GetNewsListForToday()
        {
            try
            {
               // Debugger.Launch();
                ForexNewsParser newsparser = new ForexNewsParser();
                newsparser.ParseNewsData();
                return newsparser.NewsList;
            }
            catch
            {
                return new List<ForexNews>();
            }

            
        }

        public List<ForexCity> GetCityListForToday()
        {
            try
            {
                // Debugger.Launch();
                ForexCityParser newsparser = new ForexCityParser();
                newsparser.ParseCityData();
                return newsparser.CitiesList;
            }
            catch
            {
                return new List<ForexCity>();
            }


        }
    }
}
